package com.sdhs.listmanage.service.impl;

import com.sdhs.common.utils.DateUtils;
import com.sdhs.common.utils.SecurityUtils;
import com.sdhs.listmanage.domain.GcManageListTemporary;
import com.sdhs.listmanage.domain.entity.GcManageList;
import com.sdhs.listmanage.mapper.GcManageListTemporaryMapper;
import com.sdhs.listmanage.service.IGcManageListTemporaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 清单管理Service业务层处理
 *
 * @author add
 */
@Service
public class GcManageListTemporaryServiceImpl implements IGcManageListTemporaryService {
    @Autowired
    private GcManageListTemporaryMapper gcManageListMapper;

    /**
     * 查询清单管理
     *
     * @param id 清单管理主键
     * @return 清单管理
     */
    @Override
    public GcManageList selectGcManageListById(Long id) {
        return gcManageListMapper.selectGcManageListById(id);
    }

    /**
     * 根据项目id查询清单管理
     *
     * @return 清单管理
     */
    @Override
    public List<GcManageList> selectGcManageListByProject(Long projectId) {
        return gcManageListMapper.selectGcManageListByProject(projectId);
    }


    /**
     * 查询清单管理列表
     *
     * @return 清单管理
     */
    @Override
    public List<GcManageList> selectGcManageListList(GcManageListTemporary gcManageList) {
        return gcManageListMapper.selectGcManageListList(gcManageList);
    }

    /**
     * 新增清单管理
     *
     * @param gcManageList 清单管理
     * @return 结果
     */
    @Override
    public int insertGcManageList(GcManageListTemporary gcManageList) {
        gcManageList.setCreater(SecurityUtils.getUsername());
        gcManageList.setCreateTime(DateUtils.getNowDate());
        gcManageList.setIsDelete("0");
        return gcManageListMapper.insertGcManageList(gcManageList);
    }

}
